package com.ruoyi.web.controller.shouye;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.shouye.service.IShouyeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "首页控制器")
@RestController
@RequestMapping("/system/shouye")
public class ShouyeController {

    @Autowired
    private IShouyeService shouyeService;

    @ApiOperation(value = "今日数据")
    @GetMapping("/todayData")
    public AjaxResult todayData(){
        return AjaxResult.success(shouyeService.todayData());
    }

    @ApiOperation(value = "七天内的销货和购货")
    @GetMapping("/XiaohuoAndGouhuoByWeek")
    public AjaxResult XiaohuoAndGouhuoByWeek(){
        return AjaxResult.success(shouyeService.selectXiaoshouChukuByDate());
    }

    @ApiOperation(value = "饼图库存，各仓库库存")
    @GetMapping("/kucunBycangku")
    public AjaxResult kucunBycangku(){
        return AjaxResult.success(shouyeService.kucunBycangku());
    }

    @ApiOperation(value = "今日销量，当前登陆人所在仓库今日销量排行前10")
    @GetMapping("/selectXiaoshouChukupaihangByShuliang")
    public AjaxResult cangkuShangpingPaiqianshi(){
        return AjaxResult.success(shouyeService.selectXiaoshouChukupaihangByShuliang());
    }

    @ApiOperation(value = "今日出勤情况，当前登陆人所在仓库今日出勤情况")
    @GetMapping("/selectTodayYuangongList")
    public AjaxResult selectTodayYuangongList(){
        return AjaxResult.success(shouyeService.selectTodayYuangongList());
    }
}
